import Vue from 'vue'
import App from './App.vue'
import {Button,MessageBox} from 'element-ui';
Vue.config.productionTip = false
//引入路由
import router from "../src/router/index";
//引入vuex
import store from '../src/store/index'
//统一接受api中所有的请求函数
import * as API from '@/api'
//三级联动全局组件
import TypeNav from "@/components/TypeNav/TypeNav";
import Carousel from "@/components/Carousel/Carousel";
import Pagination from "@/components/Pagination/Pagination";
Vue.component(TypeNav.name,TypeNav)
Vue.component(Carousel.name,Carousel)
Vue.component(Pagination.name,Pagination)
//引入mockServer.js
import './mock/mockServer'
//引入swiper样式
import "swiper/css/swiper.css"
//引入图片懒加载插件
import VueLazyload from 'vue-lazyload'
import atm from '@/assets/images/atm.gif'
//引入表单校验插件
import '@/plugins/validate'
Vue.use(VueLazyload,{
    //懒加载默认图片
  loading:atm
})
Vue.use(router)
//饿了么组件
Vue.use(Button).component(MessageBox)
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
new Vue({
  render: h => h(App),
  //全局事件总线
  beforeCreate() {
    Vue.prototype.$bus=this
    Vue.prototype.$API=API
  },
  router,
  store
}).$mount('#app')
